<!DOCTYPE html>
<html lang="en">
    {% block head %}
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0">
        <title>{{name}}'s WatchList </title>
        <link rel="icon" href="{{ url_for("static",filename="favicon.ico") }}"></li>
        <link rel="stylesheet" href="{{ url_for("static", filename="style.css") }}" type="text/css"></li>
    </head>
    {% endblock %}
    <body>
        {% for message in get_flashed_messages() %}  <!-- 插入到页面标题上方 -->
        <div class="alert">{{ message }}</div>
        {% endfor %}
        <h2>
            <img alt="Avatar" class="avatar" src="{{ url_for("static",filename="images/avatar.png") }}">{{name}}'s WatchList
        </h2>
        <nav>
            <ul>
                {% if current_user.is_authenticated %}
                <li><a href="{{ url_for('settings') }}">Settings</a></li>
                <li><a href="{{ url_for('logout') }}">Logout</a></li>
                {% else %}
                    <li><a href="{{ url_for('index') }}">Home</a></li>
                    <li><a href="{{ url_for('login') }}">Login</a></li>
                {% endif %}
            </ul>
        </nav>
        {% block content %}{% endblock %}
        <footer>
            <small>&copy; 2018 <a href="http://helloflask.com/book/3">HelloFlask</a></small>
        </footer>
    </body>
</html>